package com.ttnet.model;

import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;

import org.hibernate.validator.constraints.Email;
import org.hibernate.validator.constraints.NotEmpty;

import com.ttnet.model.enumerations.Role;

@Entity
@Table(name = "IMKB_USER")
public class User extends BaseModel {
	@NotNull
	@Size(min = 1, max = 25)
	private String name;

	@NotNull
	@Size(min = 1, max = 25)
	private String surname;

	@NotNull
	@Size(min = 1, max = 12)
	private String username;

	@NotNull
	@Size(min = 5)
	private String password;

	@NotNull
	@NotEmpty
	@Email
	private String email;

	@Enumerated(EnumType.ORDINAL)
	private Role role = Role.ORDINARY;

	public User() {
	}

	public User(String name, String surname, String username, String password, String email, String phoneNumber, boolean mailUser) {
		super();
		this.name = name;
		this.surname = surname;
		this.username = username;
		this.password = password;
		this.email = email;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getSurname() {
		return surname;
	}

	public void setSurname(String surname) {
		this.surname = surname;
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public Role getRole() {
		return role;
	}

	public void setRole(Role role) {
		this.role = role;
	}

}